]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Revert "network: Use NMDevice.get_available_connections(); for NMWirelessDialog"
authorGiovanni Campagna <gcampagna@src.gnome.org>
Tue, 28 Jan 2014 22:19:48 +0000 (23:19 +0100)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Thu, 6 Feb 2014 18:45:24 +0000 (19:45 +0100)
This reverts commit a36bfced473d48ffe70150ad5537bb82b1ead8e8.

get_available_connections() returns the connections that are
available right now, ie, with the currently visible APs, but
that might change while the dialog is open, so we can't use it.

https://bugzilla.gnome.org/show_bug.cgi?id=709128

js/ui/status/network.js

index 696e898cdde07b0562ee4da5f51343d645e09a4f..0520abf9955b1337617f1230fb37f3583aa6cdf6 100644 (file)
@@ -658,7 +658,7 @@ const NMWirelessDialog = new Lang.Class({
     Name: 'NMWirelessDialog',
     Extends: ModalDialog.ModalDialog,
 
-    _init: function(client, device) {
+    _init: function(client, device, settings) {
         this.parent({ styleClass: 'nm-dialog' });
 
         this._client = client;
@@ -674,7 +674,10 @@ const NMWirelessDialog = new Lang.Class({
         this._networks = [];
         this._buildLayout();
 
-        this._connections = device.get_available_connections();
+        let connections = settings.list_connections();
+        this._connections = connections.filter(Lang.bind(this, function(connection) {
+            return device.connection_valid(connection);
+        }));
 
         this._apAddedId = device.connect('access-point-added', Lang.bind(this, this._accessPointAdded));
         this._apRemovedId = device.connect('access-point-removed', Lang.bind(this, this._accessPointRemoved));
@@ -1101,9 +1104,10 @@ const NMDeviceWireless = new Lang.Class({
     Name: 'NMDeviceWireless',
     category: NMConnectionCategory.WIRELESS,
 
-    _init: function(client, device) {
+    _init: function(client, device, settings) {
         this._client = client;
         this._device = device;
+        this._settings = settings;
 
         this._description = '';
 
@@ -1171,7 +1175,7 @@ const NMDeviceWireless = new Lang.Class({
     },
 
     _showDialog: function() {
-        this._dialog = new NMWirelessDialog(this._client, this._device);
+        this._dialog = new NMWirelessDialog(this._client, this._device, this._settings);
         this._dialog.connect('closed', Lang.bind(this, this._dialogClosed));
         this._dialog.open();
     },